fix(miner): fall back to global config.apiUrl in loopoverApiUrl - #8937
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8937 +/- ##
==========================================
+ Coverage 90.56% 90.58% +0.02%
==========================================
Files 96 97 +1
Lines 22490 22542 +52
Branches 3884 3910 +26
==========================================
+ Hits 20367 20419 +52
Misses 1945 1945
Partials 178 178
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 14:03:08 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What
packages/loopover-miner/lib/github-token-resolution.ts'sloopoverApiUrl()is a hand-maintainedcopy of
loopover-mcp's config resolution (the file's own header says so — there is no sharedmodule). But it diverged:
loopover-mcpfalls backactiveProfile.apiUrl ?? config.apiUrl ?? default(a top-level/global
apiUrl), while the miner read only the active profile'sapiUrland thenwent straight to the hardcoded
DEFAULT_API_URL. A config that setapiUrlglobally (not per-profile)was silently ignored by the miner.
Change
apiUrl?to theLoopoverConfigtype (mirrorsloopover-mcp's config shape).loopoverApiUrl()now tries the active profile'sapiUrlthen the globalconfig.apiUrlbeforethe default, applying the same trim + trailing-slash normalization + legacy-URL rejection to both.
LOOPOVER_API_URLenv override still wins first; behavior when neither a profile nor a global apiUrlis set is unchanged (still the default).
Validation
test/unit/miner-github-token-resolution.test.ts: the globalconfig.apiUrlis usedwhen the profile has none (with trailing-slash normalization), and the profile's
apiUrltakesprecedence over the global one.
npx vitest run test/unit/miner-github-token-resolution.test.ts→ 30/30 pass; 100% coverage on thenew resolution branch (lcov-verified).
Closes #8854